<layout name='Layout/layout_page' />
	
	<ol class="breadcrumb">
		<li><a href="<{:U('User/index')}>">管理员设置</a></li>
      	<li class="active">列表</li>
    </ol>



	<div class="row">
		<div class="col-sm-12">
			<a class="btn btn-sm btn-info" href="<{:U('User/add')}>"><i class="icon-plus icon-white"></i> 添加</a>
		</div>
	</div>

	<p></p>

	<TABLE class="table table-striped table-bordered table-hover">
	  <THEAD>
		<tr>
		  <TH>用户名</TH>
		  <TH>用户组</TH>
		  <TH>状态</TH>
		  <TH>创建日期</TH>
		  <TH>操作</TH>
		</tr>
	  </THEAD>
	  <TBODY>             
			<volist name="list" id="vo">
			<tr>
			  <td><{$vo.username}></td>
			  <td><{$role[$vo['group']]}></td>
			  <td><if condition="$vo.status eq 0"><font color="#FF0000">关闭</font><else />开启</if></td>
			  <td><{$vo.createTime|date='Y-m-d H:i:s',###}></td>
			  <td>
			  	<a href="<{:U('User/edit' , array('id'=>$vo['id']))}>" class="btn btn-default btn-sm"><i class="glyphicon glyphicon-edit"></i> 编辑</a>
			  	<a href="javascript:void(0);" attr="delaccount_<{$vo['id']}>" class="btn btn-default btn-sm"><i class="icon-trash"></i> 删除</a>
			  	<a href="<{:U('User/log',array('id'=>$vo['id']))}>" class="btn btn-info btn-sm"><i class='icon-asterisk icon-white'></i> 登录日志</a>
			  </td>
			</tr>
			</volist>
	  </TBODY>
	</TABLE>

<script type="text/javascript">
$(document).ready(function() {
	$("a[attr^='delaccount_']").each(function(){
		var tmp = $(this).attr('attr').split('_');
		$(this).bind("click",function(){			
			var dialog = art.dialog({				
				content:'删除后不可恢复，确认吗？',
				ok:function(){
					this.content('正在删除');
					$.ajax({
						url: "<{:U('User/del')}>&id="+tmp[1]+"&temp="+new Date().getTime(),
						success: function (data){
							if(data==1){
								window.location.href = "<{:U('User/index')}>";
							}else{
								dialog.content('删除失败').time(2);
							}
						},
					});
                	return false;
					},	
				lock : true,
			});	
		});
	});
});
</script>

<input type="hidden" id="menu_action" value="sys" />